/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.yunhoo.checkFlow.db.impl;

import com.ibatis.dao.client.DaoManager;
import com.ibatis.dao.client.template.SqlMapDaoTemplate;
import com.yunhoo.checkFlow.db.dao.BaseDao;
import com.yunhoo.sys.util.common.LoginParam;
import java.util.List;

/**
 *
 * @author Administrator
 */
public class BaseImpl extends SqlMapDaoTemplate implements BaseDao {

    public BaseImpl(DaoManager daoManager) {
        super(daoManager);
    }

    @Override
    public void insert(Object obj, String namespace) {
        insert(namespace + ".insert", obj);
    }

    @Override
    public void insert01(Object obj, String namespace) {
        insert(namespace + ".insert01", obj);
    }

    @Override
    public void insert02(Object obj, String namespace) {
        insert(namespace + ".insert02", obj);
    }

    @Override
    public void insertList(List datali, String namespace) {
        startBatch();
        for (Object obj : datali) {
            insert(namespace + ".insertList", obj);
        }
        executeBatch();
    }

    @Override
    public void update(Object obj, String namespace) {
        update(namespace + ".update", obj);
    }

    @Override
    public void update01(Object obj, String namespace) {
        update(namespace + ".update01", obj);
    }

    @Override
    public void update02(Object obj, String namespace) {
        update(namespace + ".update02", obj);
    }

    @Override
    public void update03(Object obj, String namespace) {
        update(namespace + ".update03", obj);
    }

    @Override
    public void update04(Object obj, String namespace) {
        update(namespace + ".update04", obj);
    }

    @Override
    public void updateList(List datali, String namespace) {
        startBatch();
        for (Object obj : datali) {
            insert(namespace + ".updateList", obj);
        }
        executeBatch();
    }

    @Override
    public void delete(Object obj, String namespace) {
        delete(namespace + ".delete", obj);
    }

    @Override
    public void delete01(Object obj, String namespace) {
        delete(namespace + ".delete01", obj);
    }

    @Override
    public void delete02(Object obj, String namespace) {
        delete(namespace + ".delete02", obj);
    }

    @Override
    public void deleteList(List datali, String namespace) {
        startBatch();
        for (Object obj : datali) {
            insert(namespace + ".deleteList", obj);
        }
        executeBatch();
    }

    @Override
    public Object query(Object obj, String namespace) {
        return queryForObject(namespace + ".query", obj);
    }

    @Override
    public Object query01(Object obj, String namespace) {
        return queryForObject(namespace + ".query01", obj);
    }

    @Override
    public Object query02(Object obj, String namespace) {
        return queryForObject(namespace + ".query02", obj);
    }

    @Override
    public Object query03(Object obj, String namespace) {
        return queryForObject(namespace + ".query03", obj);
    }

    @Override
    public List queryList(Object obj, String namespace) {
        return queryForList(namespace + ".queryList", obj);
    }

    @Override
    public List queryList01(Object obj, String namespace) {
        return queryForList(namespace + ".queryList01", obj);
    }

    @Override
    public List queryList02(Object obj, String namespace) {
        return queryForList(namespace + ".queryList02", obj);
    }

    @Override
    public List queryList03(Object obj, String namespace) {
        System.out.println(namespace + ".queryList03");
        return queryForList(namespace + ".queryList03", obj);
    }

    @Override
    public List queryList04(Object obj, String namespace) {
        System.out.println(namespace + ".queryList04");
        return queryForList(namespace + ".queryList04", obj);
    }

    @Override
    public List queryList05(Object obj, String namespace) {
        System.out.println(namespace + ".queryList05");
        return queryForList(namespace + ".queryList05", obj);
    }

    @Override
    public List queryList06(Object obj, String namespace) {
        System.out.println(namespace + ".queryList06");
        return queryForList(namespace + ".queryList06", obj);
    }

    @Override
    public List queryList07(Object obj, String namespace) {
        System.out.println(namespace + ".queryList07");
        return queryForList(namespace + ".queryList07", obj);
    }

    @Override
    public List queryList08(Object obj, String namespace) {
        System.out.println(namespace + ".queryList08");
        return queryForList(namespace + ".queryList08", obj);
    }

    @Override
    public List queryList09(Object obj, String namespace) {
        System.out.println(namespace + ".queryList09");
        return queryForList(namespace + ".queryList09", obj);
    }

    /* * * 工作流 * * */
    @Override
    public List getFirstLevel(String namespace) {
        String orgCode = LoginParam.getOrg().getCode();
        return queryForList(namespace + ".firstLevel",orgCode);
    }

    @Override
    public List getAllList(String namespace) {
        String orgCode = LoginParam.getOrg().getCode();
        return queryForList(namespace + ".getAllList",orgCode);
    }

    @Override
    public List getGenSecList(Object object, String namespace) {
        return queryForList(namespace + ".getGenSecList", object);
    }

    @Override
    public List isExist(Object object, String namespace) {
        return queryForList(namespace + ".isExist", object);
    }

    @Override
    public List getListByQuery(Object object, String namespace) {
        return queryForList(namespace + ".getListByQuery", object);
    }

    @Override
    public List getSubLevel(Object object, String namespace) {
        return queryForList(namespace + ".subLevel", object);
    }

    @Override
    public List getGenListByObject(Object object, String namespace) {
        return queryForList(namespace + ".getGenListByObject", object);
    }

    @Override
    public List getGenForthList(Object object, String namespace) {
        return queryForList(namespace + ".getGenForthList", object);
    }

    @Override
    public List getGenSecListByObject(Object object, String namespace) {
        return queryForList(namespace + ".getGenSecListByObject", object);
    }

    @Override
    public List getGenThirdList(Object object, String namespace) {
        return queryForList(namespace + ".getGenThirdList", object);
    }

    @Override
    public List getGenList(Object object, String namespace) {
        return queryForList(namespace + ".getGenList", object);
    }  /* * * 工作流 * * */

}
